home *** CD-ROM | disk | FTP | other *** search
/ Delphi Developer's Kit 1996 / Delphi Developer's Kit 1996.iso / power / wfc007.000 / src / dcb.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1995-12-22  |  2.0 KB  |  79 lines

  1. #include <wfc.h>
  2. #pragma hdrstop
  3.  
  4. /*
  5. ** Author: Samuel R. Blackburn
  6. ** CI$: 76300,326
  7. ** Internet: sammy@sed.csc.com
  8. **
  9. ** You can use it any way you like.
  10. */
  11.  
  12. #if defined( _DEBUG )
  13. #undef THIS_FILE
  14. static char BASED_CODE THIS_FILE[] = __FILE__;
  15. #endif
  16.  
  17. CDeviceControlBlock::CDeviceControlBlock()
  18. {
  19.    ::ZeroMemory( (DCB *) this, sizeof( DCB ) );
  20.    DCBlength = sizeof( DCB );
  21.    fBinary = TRUE; // Always TRUE for NT
  22. }
  23.  
  24. CDeviceControlBlock::CDeviceControlBlock( const DCB * source )
  25. {
  26.    DCBlength = sizeof( DCB );
  27.  
  28.    Copy( source );
  29. }
  30.  
  31. CDeviceControlBlock::~CDeviceControlBlock()
  32. {
  33.    DCBlength = 0;
  34. }
  35.  
  36. void CDeviceControlBlock::Copy( const CDeviceControlBlock& source )
  37. {
  38.    Copy( (DCB *) &source );
  39. }
  40.  
  41. void CDeviceControlBlock::Copy( const DCB* source )
  42. {
  43.    ASSERT( source != NULL );
  44.  
  45.    if ( source == NULL )
  46.    {
  47.       ::ZeroMemory( (DCB *) this, sizeof( DCB ) );
  48.       DCBlength = sizeof( DCB );
  49.       fBinary = TRUE; // Always TRUE for NT
  50.       return;
  51.    }
  52.  
  53.    BaudRate          = source->BaudRate;
  54.    fBinary           = source->fBinary;
  55.    fParity           = source->fParity;
  56.    fOutxCtsFlow      = source->fOutxCtsFlow;
  57.    fOutxDsrFlow      = source->fOutxDsrFlow;
  58.    fDtrControl       = source->fDtrControl;
  59.    fDsrSensitivity   = source->fDsrSensitivity;
  60.    fTXContinueOnXoff = source->fTXContinueOnXoff;
  61.    fOutX             = source->fOutX;
  62.    fInX              = source->fInX;
  63.    fErrorChar        = source->fErrorChar;
  64.    fNull             = source->fNull;
  65.    fRtsControl       = source->fRtsControl;
  66.    fDummy2           = source->fDummy2;
  67.    wReserved         = source->wReserved;
  68.    XonLim            = source->XonLim;
  69.    XoffLim           = source->XoffLim;
  70.    ByteSize          = source->ByteSize;
  71.    Parity            = source->Parity;
  72.    StopBits          = source->StopBits;
  73.    XonChar           = source->XonChar;
  74.    XoffChar          = source->XoffChar;
  75.    ErrorChar         = source->ErrorChar;
  76.    EofChar           = source->EofChar;
  77.    EvtChar           = source->EvtChar;
  78. }
  79.